﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
using System.Collections.Concurrent;
using myAC.PreProcessing.WordLevel;

namespace myACUnitTesting
{
    [TestClass]
    public class PreProcessingTests
    {
        [TestMethod]
        public void StemmerTest()
        {
            String[] words = { "universe", "university", "universal" };
            words = @"Explain Billing	Azure Product Subscription ID: 84faf241-0ea6-4170-8d7e-1f8994968b60  Azure Product Subscription Name: Free Trial    Azure Support Subscription Name: Billing  ONe side I see Free Trial and other side I see billing that is around $38...    Can you explain me this mess, are you chraging my CC or you have not".Split(new[] { ' ', '.', ':', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            ConcurrentDictionary<String, String> dict = new ConcurrentDictionary<string, string>();


            Parallel.ForEach<String>(words, word =>
            {
                dict[word] = Stemming.Process(word);                
            });

            Assert.IsTrue(dict.Count <= words.Length); // stemming should reduce the feature count.
            //how to further verify the stemming effect?
        }
    }
}
